home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
oath.lha
/
oath
/
src
/
bag.cc
next >
Wrap
C/C++ Source or Header
|
1991-08-29
|
2KB
|
60 lines
//***************************************************************************
// OATH :: Object-oriented Abstract Type Hierarchy
//***************************************************************************
//
// Copyright (C) 1991, 1990 Texas Instruments Incorporated
// Permission is granted to any individual or institution
// to use, copy, modify, and distribute this software,
// provided that this complete copyright and permission notice
// is maintained, intact, in all copies and supporting documentation.
//
// Texas Instruments Incorporated provides this software "as is"
// without express or implied warranty.
//
//***************************************************************************
// bag (bagA, bagG)
//
// History:
// 07/91 Brian M Kennedy utility functions: deepCopy, flatten
// 06/91 Brian M Kennedy New macros & format; remove printDiagnostic
// 10/90 Brian M Kennedy Major Rewrite
// 02/90 Brian M Kennedy Original
//
//***************************************************************************
#include "copyright.h"
#include <oath/bag.h>
#include <oath/pdlQueue.h>
/////////////////////////////////////////////////////////////////////////////
// bag Outline Definitions
OUTLINES(bag, obj)
/////////////////////////////////////////////////////////////////////////////
// Utility functions
objA
deepCopy (objA O)
{bagA B = bagA::isa(O);
if(!B)
return O.makeCopy();
else
return B.make(deepCopy);
}
bagA
flatten (objA O)
{bagA B = bagA::isa(O);
if(!B)
return pdlQueueA::make() << O;
else
return B;
}
//***************************************************************************